home *** CD-ROM | disk | FTP | other *** search
- ")i amigatalk:user/database.st"
-
- amigatalk <- AmigaTalk new " Show User what we are doing. "
- dbase <- DataBase new
- recData <- DBData new: 57
- keyFile <- DBKeyFile new
-
- baseName <- 'AmigaTalk:TestFiles/Classes'
-
- template <- dbase readTemplateFrom: (baseName, '.dbf')
-
- temp <- dbase open: baseName
- keyFile openKeyFile: (baseName, '.ndx')
-
- (' ') print
- ( 'Executing the TestDBase4 file...' ) print
-
- numRecords <- dbase numberOfRecords
-
- ( baseName, ' contains ',numRecords asString, ' record(s)' ) print
-
- keyString <- '11112010/31/02'
- chk <- dbase getRecordBy: keyString from: keyFile for: recData
-
- ('ClassName of the record is: ',recData retrieveFieldAt: 0 length: 32) print
-
- amigatalk setIOTitle: 'TestDBase4 example read (via key):'
- amigatalk setIOMessage: ('key = ', keyString, ' returned:')
-
- displayStr <- String new: 256
-
- classValue <- recData retrieveFieldAt: 0 length: 32
- createdValue <- recData retrieveFieldAt: 32 length: 8
- attrCodeValue <- recData retrieveFieldAt: 40 length: 6
- notesValue <- recData retrieveFieldAt: 46 length: 10
-
- displayStr at: 0 put: 'ClassName: ',classValue, displayStr cr, \
- 'Created : ',createdValue asString, displayStr cr, \
- 'AttrCode : ',attrCodeValue asString, displayStr cr, \
- 'Notes : ',notesValue asString
-
- amigatalk displayString: displayStr
-
- dbase close
- keyFile close
-
- ( 'Done with TestDBase4 file!' ) print
-
-